//
//  ViewController.m
//  GuideViewDemo
//
//  Created by Apple on 2018/3/23.
//  Copyright © 2018年 techbird. All rights reserved.
//

#import "ViewController.h"
#import "TBGuideView.h"
#import "Masonry.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setupUI];

    [self showGuidView];
}

- (void)setupUI{
    UIImageView *imageView = [[UIImageView alloc]init];
    imageView.image = [UIImage imageNamed:@"cozy-control-car"];
    [self.view addSubview:imageView];
    imageView.contentMode = UIViewContentModeScaleAspectFit;
    [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.view.mas_centerY).offset(0);
        make.left.equalTo(self.view.mas_left).offset(20);
        make.right.equalTo(self.view.mas_right).offset(-20);
        make.height.equalTo(imageView.mas_height).offset(0);
    }];
}

- (void)showGuidView{
    TBGuideView *guideView = [[TBGuideView alloc]init];
    guideView.frame = self.view.bounds;
    [self.view addSubview:guideView];
    guideView.imageNames = [self loadImageNames];
}

- (NSArray *)loadImageNames{
    NSInteger imageCount = 4;
    NSMutableArray *images = [NSMutableArray arrayWithCapacity:imageCount];
    for (NSInteger i = 0; i<imageCount; i++) {
        NSString *name = [@"common_h" stringByAppendingFormat:@"%zd.jpg",i+1];
        [images addObject:name];
    }
    return images.copy;
}



@end
